package com.lh7.ledger.service.impl;

import com.lh7.ledger.mapper.UsersMapper;
import com.lh7.ledger.service.IUsersService;
import org.apache.catalina.User;
import pojo.Users;

import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import org.springframework.stereotype.Service;

import java.util.Map;
import java.util.Set;
import java.util.stream.Collectors;

/**
 * <p>
 *  服务实现类
 * </p>
 *
 * @author lh7
 * @since 2025-07-02
 */
@Service
public class UsersServiceImpl extends ServiceImpl<UsersMapper, Users> implements IUsersService {
    @Override
    public Map<Long, String> getUserNamesByIds(Set<Long> ids) {
        return this.listByIds(ids).stream()
                .collect(Collectors.toMap(Users::getId, Users::getUsername));
    }

}
